package com.dd.duu.service.fallback;

import com.dd.duu.service.TestClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 描述:
 *
 * @author: yanglin
 * @Date: 2021-03-03-13:43
 * @Version: 1.0
 */
@Component
public class TestFallBackFactory implements FallbackFactory<TestClient> {


    @Override
    public TestClient create(Throwable cause) {
        return new TestClient() {
            @Override
            public String queryTest() {
                return "queryTest 触发服务降级";
            }

            @Override
            public String queryTestStr(String name) {
                return "queryTestStr 触发服务降级";
            }
        };
    }
}
